package com.jwx.mycar.utils;

/**
 * @program: mycar
 * @description:
 * @author: jwx
 * @create: 2019-11-15 21:32
 **/

import java.util.Random;

/***
 * 生成随机唯一主键
 * 格式：时间 + 随机数
 */
public class KeyUtil {

    public static synchronized String genUniqueKey() {
        Random random = new Random();
        Integer number = random.nextInt(900000) + 100000;
        return System.currentTimeMillis() + String.valueOf(number);
    }
}
